package _2_2基础算法;

import java.util.Scanner;

public class _325标题统计 {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		String title = scan.nextLine();
		int count = 0;
		for(int i = 0;i < title.length(); i++) {
			char c = title.charAt(i);
			if(c != ' ' && c != '\n') {
				count++;
			}
		}
		System.out.print(count);
		
		scan.close();
	}

}
